<?php
// hemliga sakerer

if($_SESSION['Username'] == "mail")
{
$Name = $_POST["Name"];
$From = $_POST["From"];
$To = $_POST["To"];
$Text = $_POST["Text"]; 
$Subject = $_POST["Subject"];
$Header = "From: ". $Name . " <" . $From . ">\r\n"; 

mail($To, $Subject, $Text, $Header);

 	
	echo "<form method=\"post\">";
	echo "Name: ";
	echo "<input name=\"Name\"><br>";
	echo " From: ";
	echo "<input name=\"From\"><br>";
	echo " To: ";
	echo "<input name=\"To\"><br>";
	echo " Subject: ";
	echo "<input name=\"Subject\"><br><br>";
	echo "Text:";
	echo "<textarea name=\"Text\" style=\" width: 100%; height: 300px;\"></textarea><br><br>";
	echo "<input type=\"submit\"><br>";
	echo "</form>";
}
else
{
	echo "DET FINNS INGEN MAIL";
}



?>